package retrofit2.harmony.net;

import io.reactivex.Observable;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.harmony.model.HomeArticleModel;
import retrofit2.harmony.model.base.HttpModel;
import retrofit2.harmony.model.base.PageModel;
import retrofit2.http.GET;
import retrofit2.http.Path;

public interface WanAndroid {
    /**
     * RxJava，获取首页文章列表
     */
    @GET("article/list/{page}/json")
    Observable<HttpModel<PageModel<HomeArticleModel>>> getHomeArticle(@Path("page") int page);

    /**
     * Retrofit Call，获取首页文章列表，如果不添加转换器，则泛型只能是ResponseBody
     */
    @GET("article/list/{page}/json")
    Call<ResponseBody> getHomeArticleByCall(@Path("page") int page);

    /**
     * 添加了转换器，则可以直接用模型类的泛型，不需要ResponseBody了
     */
    @GET("article/list/{page}/json")
    Call<HttpModel<PageModel<HomeArticleModel>>> getHomeArticleByCallWithConverter(
            @Path("page") int page
    );
}